<template>
  <div class="user-dashboard">
    <el-row :gutter="20">
      <el-col :span="12">
        <el-card class="feature-card">
          <h3>参与问卷</h3>
          <p>查看并填写当前发布的问卷</p>
          <el-button @click="goToSurveys" type="primary">前往问卷</el-button>
        </el-card>
      </el-col>
      <el-col :span="12">
        <el-card class="feature-card">
          <h3>历史记录</h3>
          <p>查看您已填写的问卷记录</p>
          <el-button @click="goToHistory" type="success">查看历史</el-button>
        </el-card>
      </el-col>
    </el-row>

    <el-button @click="logout" class="logout-button" type="danger">退出登录</el-button>
  </div>
</template>

<script>
export default {
  data() {
    return {
      username: '用户'
    };
  },
  methods: {
    logout() {
      this.$router.push('/login');
    },
    goToSurveys() {
      // TODO: 实现跳转逻辑
    },
    goToHistory() {
      // TODO: 实现历史记录页面跳转
    }
  }
};
</script>

<style scoped>
.user-dashboard {
  padding: 40px;
}

.feature-card {
  height: 200px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.logout-button {
  margin-top: 20px;
}
</style>